home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / nfsmount / mount.x < prev    next >
Encoding:
Text File  |  1988-11-02  |  4.3 KB  |  160 lines

  1. /* @(#)mount.x 1.4 88/02/08 Copyr 1987 Sun Micro */
  2. /*
  3.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  4.  * unrestricted use provided that this legend is included on all tape
  5.  * media and as a part of the software program in whole or part.  Users
  6.  * may copy or modify Sun RPC without charge, but are not authorized
  7.  * to license or distribute it to anyone else except as part of a product or
  8.  * program developed by the user.
  9.  * 
  10.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  11.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  12.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  13.  * 
  14.  * Sun RPC is provided with no support and without any obligation on the
  15.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  16.  * modification or enhancement.
  17.  * 
  18.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  19.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  20.  * OR ANY PART THEREOF.
  21.  * 
  22.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  23.  * or profits or other special, indirect and consequential damages, even if
  24.  * Sun has been advised of the possibility of such damages.
  25.  * 
  26.  * Sun Microsystems, Inc.
  27.  * 2550 Garcia Avenue
  28.  * Mountain View, California  94043
  29.  */
  30.  
  31. /*
  32.  * Protocol description for the mount program
  33.  */
  34.  
  35.  
  36. const MNTPATHLEN = 1024;    /* maximum bytes in a pathname argument */
  37. const MNTNAMLEN = 255;        /* maximum bytes in a name argument */
  38. const FHSIZE = 32;        /* size in bytes of a file handle */
  39.  
  40. /*
  41.  * The fhandle is the file handle that the server passes to the client.
  42.  * All file operations are done using the file handles to refer to a file
  43.  * or a directory. The file handle can contain whatever information the
  44.  * server needs to distinguish an individual file.
  45.  */
  46. typedef opaque fhandle[FHSIZE];    
  47.  
  48. /*
  49.  * If a status of zero is returned, the call completed successfully, and 
  50.  * a file handle for the directory follows. A non-zero status indicates
  51.  * some sort of error. The status corresponds with UNIX error numbers.
  52.  */
  53. union fhstatus switch (unsigned fhs_status) {
  54. case 0:
  55.     fhandle fhs_fhandle;
  56. default:
  57.     void;
  58. };
  59.  
  60. /*
  61.  * The type dirpath is the pathname of a directory
  62.  */
  63. typedef string dirpath<MNTPATHLEN>;
  64.  
  65. /*
  66.  * The type name is used for arbitrary names (hostnames, groupnames)
  67.  * (Changed to "arbname" because "name" is too good to waste.
  68.  */
  69. typedef string arbname<MNTNAMLEN>;
  70.  
  71. /*
  72.  * A list of who has what mounted
  73.  */
  74. struct mountlist {
  75.     arbname ml_hostname;
  76.     dirpath ml_directory;
  77.     mountlist *ml_next;
  78. };
  79.  
  80. /*
  81.  * A list of netgroups
  82.  */
  83. typedef struct groupnode *groups;
  84. struct groupnode {
  85.     arbname gr_name;
  86.     groups gr_next;
  87. };
  88.  
  89. /*
  90.  * A list of what is exported and to whom
  91.  */
  92. typedef struct exportnode *exports;
  93. struct exportnode {
  94.     dirpath ex_dir;
  95.     groups ex_groups;
  96.     exports ex_next;
  97. };
  98.  
  99. program MOUNTPROG {
  100.     /*
  101.      * Version one of the mount protocol communicates with version two
  102.      * of the NFS protocol. The only connecting point is the fhandle 
  103.      * structure, which is the same for both protocols.
  104.      */
  105.     version MOUNTVERS {
  106.         /*
  107.          * Does no work. It is made available in all RPC services
  108.          * to allow server reponse testing and timing
  109.          */
  110.         void
  111.         MOUNTPROC_NULL(void) = 0;
  112.  
  113.         /*    
  114.          * If fhs_status is 0, then fhs_fhandle contains the
  115.           * file handle for the directory. This file handle may
  116.          * be used in the NFS protocol. This procedure also adds
  117.          * a new entry to the mount list for this client mounting
  118.          * the directory.
  119.          * Unix authentication required.
  120.          */
  121.         fhstatus 
  122.         MOUNTPROC_MNT(dirpath) = 1;
  123.  
  124.         /*
  125.          * Returns the list of remotely mounted filesystems. The 
  126.          * mountlist contains one entry for each hostname and 
  127.          * directory pair.
  128.          */
  129.         mountlist
  130.         MOUNTPROC_DUMP(void) = 2;
  131.  
  132.         /*
  133.          * Removes the mount list entry for the directory
  134.          * Unix authentication required.
  135.          */
  136.         void
  137.         MOUNTPROC_UMNT(dirpath) = 3;
  138.  
  139.         /*
  140.          * Removes all of the mount list entries for this client
  141.          * Unix authentication required.
  142.          */
  143.         void
  144.         MOUNTPROC_UMNTALL(void) = 4;
  145.  
  146.         /*
  147.          * Returns a list of all the exported filesystems, and which
  148.          * machines are allowed to import it.
  149.          */
  150.         exports
  151.         MOUNTPROC_EXPORT(void)  = 5;
  152.     
  153.         /*
  154.          * Identical to MOUNTPROC_EXPORT above
  155.          */
  156.         exports
  157.         MOUNTPROC_EXPORTALL(void) = 6;
  158.     } = 1;
  159. } = 100005;
  160.